package prototype.deepClone;

import cn.hutool.core.util.ObjectUtil;

/**
 * @program: DesignModeProject
 * @description:
 * @author: Li canzhang
 * @create: 2022-05-15 11:10
 **/
public class Client {
    public static void main(String[] args) {
        CloneProtoType cloneProtoType = new CloneProtoType();
        cloneProtoType.setName("原型类");
        cloneProtoType.setDeepCloneTarget(new DeepCloneTarget("克隆目标类"));

        CloneProtoType cloneProtoType1 = cloneProtoType.deepClone();
        CloneProtoType cloneProtoType2 = cloneProtoType.deepClone();

        System.out.println(cloneProtoType1.getDeepCloneTarget().hashCode());
        System.out.println( cloneProtoType2.getDeepCloneTarget().hashCode());


        //糊涂工具包
        CloneProtoType clone = ObjectUtil.clone(cloneProtoType);
    }
}
